/**
 * Created By  醉美柳舞之众星捧月
 * @author Song
 * @date 2018/6/13 14:53
 */
/**
 * Author song  醉美柳舞之众星捧月
 * Date & Time  2018/6/13 14:58
 * Description  据说这个类是来操作数据的
 */
import { createConnection } from 'typeorm';
import { User } from './User';

createConnection(/*...*/).then(async connection => {
  const user = new User();
  user.name = 'Me and Bears';
  user.description = 'I am near polar bears';
  user.fileName = 'user-with-bears.jpg';
  user.views = 1;
  user.isPublished = true;
  await connection.entityManager.persist(user);
  console.log('Photo has been saved');
}).catch(error => console.log(error));